package io;

import java.io.File;

public class IODemo7 {
    public static void main(String[] args) {
        File src = new File("./text_old.txt");
        File dest = new File("./text_new.txt");
        boolean ret = src.renameTo(dest);
        System.out.println(ret);//此时发现文件名被改变了,同时也可以改变文件路径

    }
}
